<?php

class Core_Data_UDD_Structure_Database {

    private $arrTables = array();

    private $strName;

    function __construct ( $strName ) {
        $this->TableCollection = new ArrayObject ();
        $this->strName = $strName;
    }

    function __toString () {
        return $this->strName;
    }

    public function addTable ( Core_Data_UDD_Structure_Document $objDocument, $strName, $strPrefix = null ) {
        $objTable = new Core_Data_UDD_Structure_Table ( $objDocument, $this, $strName, $strPrefix );
        $this->arrTables[$objTable->__toString()] = $objTable;
        $objDocument->appendTable( $objTable );
        return $objTable;
    }

    public function tables () {
        return (object) $this->arrTables;
    }

}

?>
